﻿using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;

namespace ERListItem.EventReceiver1
{
    /// <summary>
    /// List Item Events
    /// </summary>
    public class EventReceiver1 : SPItemEventReceiver
    {
       /// <summary>
       /// An item was added
       /// </summary>
       public override void ItemAdded(SPItemEventProperties properties)
       {
           //SPSecurity.RunWithElevatedPrivileges(delegate
           //{
               if (properties.ListTitle.Equals("ListaAle"))
               {
                   SPItem ale = properties.ListItem;
                   ale["RespEvento"] = "Teste";
                   ale.Update();
               }
           //});

           base.ItemAdded(properties);
       }


    }
}
